Sets the binding if the dependency property has not been set previously and the style of the element don't set the property.

Namespace:  C1.Silverlight
Assembly:  C1.Silverlight (in C1.Silverlight.dll)

Syntax

C#
public static void SetBinding<T>(
	this FrameworkElement target,
	DependencyProperty dp,
	T source,
	Expression<Func<T, Object>> expr,
	IValueConverter converter
)
Visual Basic
<ExtensionAttribute> _
Public Shared Sub SetBinding(Of T) ( _
	target As FrameworkElement, _
	dp As DependencyProperty, _
	source As T, _
	expr As Expression(Of Func(Of T, Object)), _
	converter As IValueConverter _
)

Parameters

target
Type: System.Windows..::..FrameworkElement
The target.
dp
Type: System.Windows..::..DependencyProperty
The dependency property which will be set.
source
Type: T
The source.
expr
Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'T, Object>)>)>>)>)>
Expression that returns a property of the source object.
converter
Type: System.Windows.Data..::..IValueConverter
The converter that will be applied to the created binding object.

Type Parameters

T
Type of the source

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FrameworkElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also